/*
 * *****************************************************************************
 *  Copyright ( c ) 2019 huibur Inc. All Rights Reserved.
 *
 *  This software is the confidential and proprietary information of Huibur Inc
 *  (*Confidential Information*). You shall not disclose such Confidential Information
 *  and shall use it only in accordance with the terms of the license agreement
 *  you entered into with Huibur or a Huibur authorized
 *  reseller (the "License Agreement*).
 *  ******************************************************************************
 */

package com.huibur.devicecheck.model.param;

import com.huibur.devicecheck.constant.Constants;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/*******************************************************
* Title: PageParam.java
* Description:
* @author baiqingshuo
* @date 2021/9/24
* @version 1.0
*******************************************************/
@Getter
@Setter
public class PageParam implements Serializable {

    @ApiModelProperty(value = "页码,默认为1", example = "1")
    private Integer current;

    @ApiModelProperty(value = "页大小,默认为10", example = "10")
    private Integer pageSize;


    public Integer getCurrent() {
        if (current == null || current <= 0) {
            this.current = Constants.DEFAULT_PAGE_INDEX;
        }
        return current;
    }

    public Integer getPageSize() {
        if (pageSize == null || pageSize <= 0) {
            this.pageSize = Constants.DEFAULT_PAGE_SIZE;
        }
        return pageSize;
    }

}